<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/newbase.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/bootstrap.min.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>消息</title>
    <style>
        .media{
            /*width: 94%;*/
            margin: 0 auto;
            padding: 10px 3%;
            border-bottom:1px solid #F6F6F6;
        }
        .media:last-child{
            border-bottom: none;
        }
        .media-left{
            padding-right: 14px;
        }
        .media-object{
            width:40px;
            height: 40px;
        }
        .media-body{
            width: 100%;
        }
        .media-body .title{
            font-size: 14px;
            line-height: 20px;
            color: #212121;
        }
        .media-body .title .time{
            color: #B6B6B6;
            float: right;
            font-size: 12px;
        }
        .media-body .det{
            font-size: 12px;
            line-height: 20px;
            color: #B6B6B6;
        }
        .media>a:active{
            text-decoration: none;
        }
    </style>
{include file="public/href" /}
</head>
<body>
<div class="wrap-message">
    <div class="header">
        <p>消息({$count})</p>
        <img src="__STATIC__/img/back.png" class="back" onclick='jump("{:input('act','')}")'>
    </div>

    <!--<div class="media">-->
        <!--<div class="media-left">-->
            <!--<img src="__STATIC__/img_user/xx-xiaozizhongxin.png" class="media-object">-->
        <!--</div>-->
        <!--<div class="media-body media-middle">-->
            <!--<div class="title">系统消息<span class="time right">2015-12-12</span></div>-->
            <!--<div class="det">消息详情消息详情消息详情</div>-->
        <!--</div>-->
    <!--</div>-->
    <!--<div class="main"><a href="'+url+'"><img lay-src="__STATIC__/img_user/xx-xiaozizhongxin.png">-->
        <!--<div class="news1"><p>'+item.title+'<span>'+item.create_time+'</span><br/></p><span-->
                <!--style="text-overflow:ellipsis;white-space: nowrap;width: 95%;display: block;overflow: hidden">'+item.content+'</span>-->
        <!--</div>-->
    <!--</a></div>-->
    <div class="content"></div>
</div>
{include file="public/src" /}
<script>
function jump(){
    var url = sessionStorage.getItem('my_message');

    window.location.href = url;

}
    //layer流加载
    layui.use('flow', function() {
        var $ = layui.jquery;
        var flow = layui.flow;
        flow.load({
            elem: '.content' //流加载容器
            ,isAuto:true
            ,isLazyimg:true
            ,done: function(page, next){ //执行下一页的回调
                var lis = [];
                $.ajax({
                    url:"{:url('mobile/user_info/message_index')}",
                    dataType:'json',
                    type:'post',
                    data:{'page':page},
                    success:function(t){
                        console.log(t);
                        layui.each(t.data, function(index, item){
                            var url = "{:url('mobile/user_info/message_details')}?id="+item.id;
                            lis.push(' <div class="media"><a href="'+url+'"><div class="media-left"><img lay-src="__STATIC__/img_user/xx-xiaozizhongxin.png" class="media-object"></div><div class="media-body media-middle"><div class="title">'+item.title.substr(0,16)+'<span class="time right">'+item.create_time+'</span></div><div class="det" style="text-overflow:ellipsis;white-space: nowrap;width: 95%;display: block;overflow: hidden">'+item.content.substr(0,22)+'</div> </div></a></div>');
                        });
                        next(lis.join(''), page < t.pages);
                    },
                    error: function () {
                        layer.open({content:'网络繁忙,请重试',skin:'msg',time:2});
                    }
                })
            }
        });
    });
</script>
</body>
</html>